package way.learning.yiyi.communicate;

public class B implements Runnable {
    private ThreadStop t;
    public B(ThreadStop t) {
        this.t = t;
    }
    public void run() {
        while (t.isValue()) {}
        System.out.println(Thread.currentThread().getName() + " is stoped by another Thread");
    }
}
